/*
 * Copyright (c) 2006 - 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

/**
 * <p>Project: app2022 - TestAnn
 * <p>Powered by webrx On 2022-02-09 09:36:01
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */

@Ann(name = "张三丰", age = 25, sex = "女")
public class TestAnn {

    @Ann(name = "张三丰", age = 25, sex = "女")
    @Ann(name = "James")
    public static void main(String[] args) {

        var c = TestAnn.class;
        if (c.isAnnotationPresent(Anns.class)) {
            //System.out.println("有注解@Ann");
            Ann[] ann = c.getAnnotation(Anns.class).value();
            System.out.println(ann[0].sex());
            System.out.println(ann[0].name());
            System.out.println(ann[0].age());

            System.out.println(ann[1].sex());
            System.out.println(ann[1].name());
            System.out.println(ann[1].age());
        } else if (c.isAnnotationPresent(Ann.class)) {
            var ann = c.getAnnotation(Ann.class);
            System.out.println(ann.sex());
            System.out.println(ann.name());
            System.out.println(ann.age());
        }
    }

    public int pf(int a, int b) {
        return a * b;
    }
}
